<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />
<title>ProductInfo.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" type="text/css" href="css/easyui.css"></link>
<link rel="stylesheet" type="text/css" href="css/icon.css"></link>
<link rel="stylesheet" type="text/css" href="css/hfy.css"></link>
<script type="text/javascript" src="jquery/jquery-1.8.0.js"></script>
<script type="text/javascript" src="jquery/jquery.easyui.min.js"></script>
<script type="text/javascript">
	$(document).ready($(function() {
		$("#product_data").datagrid({
			title : "产品设置",
			loadMsg : "数据加载中，请稍后……",
			url : "nb?sql=select * from productinfo",
			idField : 'id',
			rownumbers : true,
			pageNumber:1,
			pageSize : 20,
			singleSelect : true,
			pagination : true,
			autoRowHeight : false,
			toolbar:[{
					text:'增加',
					iconCls:'icon-add',
					handler:function(){
						
					}
				},'-',{
					text:'保存',
					iconCls:'icon-save',
					handler:function(){
						$("#product_data").datagrid("acceptChanges");
					}
				},'-',{
					text:'取消',
					iconCls:'icon-undo',
					handler:function(){
						$("#product_data").datagrid("rejectChanges");
					}
				},'-']
		});
		$("#product_data").datagrid("getPager").pagination(
				{
					displayMsg : '当前显示从第{from}条到{to}条 共{total}条记录',
					onSelectPage : function(pageNumber, pageSize) {
						var nowURL = $("#product_data").datagrid("options").url;
						var index = nowURL.lastIndexOf("&pn=");
    					if(index==-1){
    						index = nowURL.length;
    					}
    					var mUrl = nowURL.substring(0,index)+"&pn="+pageNumber+"&ps="+pageSize;
						$("#product_data").datagrid("options").url=mUrl;
						$("#product_data").datagrid("reload");
					}
				});
			$("#edit_panel").dialog({
					title:"选择框",
					buttons:[{
						text:"确定",
						iconCls:"icon-ok",
						handler:function(){
							var row = $("#ref_brand").datagrid("getSelected");
							if(row){
								var brandTarget =$("#body_data").datagrid("getEditor",{index:lastIndex,field:"brand"});
								$(brandTarget.target).searchbox("setValue",row.brand);
							}
							$("#ref_brand_panel").dialog("close");					
						}
					},{
						text:"取消",
						iconCls:"icon-no",
						handler:function(){
							$("#ref_brand_panel").dialog("close");
						}
					}]
				});
			$("#edit_panel").dialog("close");
		
}));


</script>
</head>
<body>
	<div id="edit_panel" style="padding:5px;width:400px;height:300px;">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="STYLE112">
			<tr>
				<td width="15%"><div align="center" class="STYLE2 STYLE1">单据号</div></td>
				<td width="10%" class="STYLE4"><select id="qv_doccode"><option value='>='>大于等于</option>
						<option value='=' selected="selected">等于</option>
						<option value='>'>大于</option>
						<option value='<='>小于等于</option>
						<option value='<'>小于</option>
				</select></td>
				<td width="70%"><div align="left" class="STYLE2 STYLE1">
						<input type="text" id="doccode" class="STYLE111" />
					</div>
				</td>
			</tr>
		</table>
	</div>

	<table id="product_data" class="easyui-datagrid" width="100%;">
		<thead>
			<tr>
				<th data-options="field:'id',width:80">id</th>
				<th data-options="field:'code',width:80,editor:{type:'text'}">code</th>
				<th data-options="field:'productname',width:80,editor:{type:'text'}">productname</th>
				<th data-options="field:'price',width:80,editor:{type:'numberbox',options:{precision:2}}">price</th>
				<th data-options="field:'unit',width:80,editor:{type:'text'}">unit</th>
			</tr>
		</thead>
	</table>
	
</body>
</html:html>
